<template>
	<view class="container">



		<uni-section title="您的积分小助手!" type="line">
			<view class="fu">


				<view class="card-actions">
					<view class="icon">
						<u-icon name="red-packet-fill" color="#2979ff" size="38"></u-icon>
					</view>
					<view class="text">{{integral}}</view>
				</view>
			</view>
		</uni-section>
	</view>
</template>

<script>
	import OrderApi from '@/common/FindingService/OrderApi.js';
	export default {
		components: {},
		uesr: '',
		userId: '',
		data() {
			return {
				cover: '',
				integral: '',
				user: '',
				avatar: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/460d46d0-4fcc-11eb-8ff1-d5dcf8779628.png',
				extraIcon: {
					color: '#4cd964',
					size: '22',
					type: 'gear-filled'
				}
			}
		},
		mounted() {
			// this.clickUser()
			this.userId = uni.getStorageSync('userId');
			console.log('用户id', this.userId)
			//加载用户
			OrderApi.queryUser(this.userId).then(res => {
				this.user = res.data.data
				console.log('用户信息', this.user)
				this.integral = this.user.integral + ' 积分'

			})
		},
		methods: {

			goto(url) {
				if (!this.user) {
					uni.navigateTo({
						url: url
					})
				} else {
					uni.navigateTo({
						url: url
					})
				}

			},
			onClick(e) {
				console.log(e)
			},
			actionsClick(text) {
				uni.showToast({
					title: text,
					icon: 'none'
				})
			}
		}
	}
</script>

<style lang="scss">
	.fu {
		position: relative;
		background-image: url('../../static/qb.png');
		width: 94%;
		height: 800rpx;
		background-repeat: no-repeat;
		background-size: 100% 70%;
	}

	.card-actions {
		position: absolute;
		top: 300rpx;
		left: 185rpx;
		width: 240rpx;

		// display: flex;
		.icon {
			width: 38px;
			margin: 0 auto;
		}

		.text {
			display: block;
			height: 38px;
			line-height: 38px;
			font-size: 20px;
			color: #fff;
			font-weight: bolder;
			text-align: center;
		}

	}
</style>